function validate_form () 

{

first_name = document.cash_payment_details.first_name;
last_name = document.cash_payment_details.last_name;
address1 = document.cash_payment_details.address1;
address2 = document.cash_payment_details.address2;
town = document.cash_payment_details.town;
postcode = document.cash_payment_details.postcode;
email = document.cash_payment_details.email;
number = document.cash_payment_details.number;

complete = 0;

if(first_name.value == "")
{ first_name.className = "missing", complete++;} else {first_name.className = "complete";}

if(last_name.value == "")
{ last_name.className = "missing", complete++;} else {last_name.className = "complete";}

if(address1.value == "")
{ address1.className = "missing", complete++;} else {address1.className = "complete";}

if(town.value == "")
{ town.className = "missing", complete++;} else {town.className = "complete";}

if(postcode.value == "")
{ postcode.className = "missing", complete++;} else {postcode.className = "complete";}

filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;

if(!filter.test(email.value)) 
{ email.className = "missing", complete++;} else {email.className = "complete";}

filter = /^\(?0\d{3,5}\)?\s?\d{3,4}\s?\d{3,4}(\s?\#(\d{4}|\d{3}))?$/;

if(!filter.test(number.value))
{ number.className = "missing", complete++;} else {number.className = "complete";}
if (complete == 0)
{document.cash_payment_details.submit();}

}